<?php

  require_once "JooS/PHPackager/FS.php";

  class JooS_PHPackager_FS_PHPUnit_Testing extends JooS_PHPackager_FS {
    /**
     * @var JooS_PHPackager_FS
     */
    private static $_oldInstance = null;

    /**
     * @var JooS_PHPackager_FS_PHPUnit_Testing
     */
    private static $_newInstance = null;

    public static function changeInstance() {
      if (is_null(self::$_oldInstance)) {
        self::$_oldInstance = self::getInstance();
      }
      if (is_null(self::$_newInstance)) {
        self::$_newInstance = new self();
      }
      self::$_instance = self::$_newInstance;
    }

    public static function restoreInstance() {
      if (!is_null(self::$_oldInstance)) {
        self::$_instance = self::$_oldInstance;
      }
    }
  }
